#ifndef PCM_TOWAV_H
#define PCM_TOWAV_H

#include <QObject>
struct WAVE_HEADER {
    char ChunkID[4];         // "RIFF"
    unsigned long ChunkSize; // 文件大小 - 8
    char Format[4];          // "WAVE"
};

struct WAVE_FMT {
    char Subchunk1ID[4];     // "fmt "
    unsigned long Subchunk1Size;  // 16
    unsigned short AudioFormat;   // 1 (PCM)
    unsigned short NumChannels;   // 声道数
    unsigned long SampleRate;     // 采样率
    unsigned long ByteRate;       // 每秒字节数
    unsigned short BlockAlign;    // 每个采样的字节数
    unsigned short BitsPerSample; // 每个采样的位数
};

struct WAVE_DATA {
    char Subchunk2ID[4];     // "data"
    unsigned long Subchunk2Size; // 数据大小
};
class pcm_towav
{
public:
    //参数：wav文件路径、pcm文件路径、声道数、采样率、位数
    pcm_towav(QString pathWav,QString pathPcm,const int NumChannels,const int SampleRate,const int BitsPerSample);
    WAVE_HEADER *pcmHEADER;
    WAVE_FMT* pcmFMT;
    WAVE_DATA* pcmDATA;

};

#endif // PCM_TOWAV_H
